<template>
  <!-- 注册 typeNum=0-->
  <div>
      <HeaderCom></HeaderCom>
      <!-- 注册流程 -->
      <registerFlow :registerFlowData="registerFlowData"></registerFlow>
      <!-- 验证身份 -->
      <identity :show="identityShow" :typeNum="0" @flowPClick="flowPClick" @getData="getData"></identity>
      <!-- 填写信息 -->
      <message :show="messageShow" :typeNum="0" @flowPClick="flowPClick" @getData="getData"></message>
      <!-- 设置密码 -->
      <password :show="passwordShow" :typeNum="0" :getMData="getMData" :getPData="getPData" @flowPClick="flowPClick"></password>
      <!-- 完成注册 -->
      <complete :show="completeShow" :typeNum="0" @flowPClick="flowPClick"></complete>
  </div>
</template>

<script>
// 注册流程
import registerFlow from '@/components/registerFlow'
// 验证身份
import identity from '@/components/register/identity'
// 填写信息
import message from '@/components/register/message'
// 设置密码
import password from '@/components/register/password'
// 完成注册
import complete from '@/components/register/complete'
// 头部
import Header from '@/components/header2'

export default {
  data () {
    return {
      identityShow: true,
      messageShow: false,
      passwordShow: false,
      completeShow: false,
      registerFlowData: {
        'choice': '验证身份',
        'validate': '填写信息',
        'password': '设置密码',
        'complete': '完成',
        'identityShowI': true,
        'messageShowI': false,
        'passwordShowI': false,
        'completeShowI': false,
      },
      getMData: '',
      getPData: ''
    }
  },
  methods: {
    flowPClick: function (obj) {
      this.identityShow = obj.identityShow
      this.messageShow = obj.messageShow
      this.passwordShow = obj.passwordShow
      this.completeShow = obj.completeShow
      this.registerFlowData.identityShowI = obj.identityShowI
      this.registerFlowData.messageShowI = obj.messageShowI
      this.registerFlowData.passwordShowI = obj.passwordShowI
      this.registerFlowData.completeShowI = obj.completeShowI
    },
    getData: function (type, data) {
      if (type === 'message') {
        this.getMData = data
      } else if (type === 'phone') {
        this.getPData = data
      }
    }
  },
  components: {
    'identity': identity,
    'message': message,
    'password': password,
    'complete': complete,
    'HeaderCom': Header,
    'registerFlow': registerFlow
  }
}
</script>

<style>
  @import '../../../static/register/register.css'
</style>
